home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DartmouthXCMDs.cpt / Dartmouth XCMDs Vol 1&2 / card_4672.txt < prev    next >
Text File  |  1989-02-26  |  19KB  |  569 lines

  1. -- card: 4672 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3241
  5. -- name: FileToField
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=79 top=300 right=322 bottom=179
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: FileToField
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   FileToField "card field 1"
  23.   put the result into theResult
  24.   put theResult
  25.   if theResult is not "Cancel" then
  26.     if word 1 of theResult is not "Error" then
  27.       show card field 1
  28.       set the visible of card button 2 to true
  29.     end if
  30.   end if
  31. end mouseUp
  32.  
  33.  
  34.  
  35. -- part 2 (field)
  36. -- low flags: 80
  37. -- high flags: 2007
  38. -- rect: left=265 top=33 right=296 bottom=486
  39. -- title width / last selected line: 0
  40. -- icon id / first selected line: 0 / 0
  41. -- text alignment: 0
  42. -- font id: 20
  43. -- text size: 12
  44. -- style flags: 0
  45. -- line height: 16
  46. -- part name: FileToField Text
  47.  
  48.  
  49. -- part 3 (button)
  50. -- low flags: 80
  51. -- high flags: A003
  52. -- rect: left=284 top=268 right=290 bottom=458
  53. -- title width / last selected line: 0
  54. -- icon id / first selected line: 0 / 0
  55. -- text alignment: 1
  56. -- font id: 0
  57. -- text size: 12
  58. -- style flags: 0
  59. -- line height: 16
  60. -- part name: Empty and Hide this Field
  61. ----- HyperTalk script -----
  62. on mouseUp
  63.   set lockscreen to true
  64.   put empty into card field 1
  65.   hide card field 1
  66.   set the visible of me to false
  67.   set lockscreen to false
  68. end mouseUp
  69.  
  70.  
  71.  
  72. -- part 6 (field)
  73. -- low flags: 80
  74. -- high flags: 2007
  75. -- rect: left=12 top=26 right=298 bottom=491
  76. -- title width / last selected line: 0
  77. -- icon id / first selected line: 0 / 0
  78. -- text alignment: 0
  79. -- font id: 22
  80. -- text size: 10
  81. -- style flags: 0
  82. -- line height: 13
  83. -- part name: Source
  84.  
  85.  
  86. -- part 7 (button)
  87. -- low flags: 00
  88. -- high flags: A003
  89. -- rect: left=314 top=300 right=322 bottom=435
  90. -- title width / last selected line: 0
  91. -- icon id / first selected line: 0 / 0
  92. -- text alignment: 1
  93. -- font id: 0
  94. -- text size: 12
  95. -- style flags: 0
  96. -- line height: 16
  97. -- part name: Show LSP Source
  98. ----- HyperTalk script -----
  99. on mouseUp
  100.   set the visible of card field "Source" to not the visible of card field "Source"
  101.   if the visible of card field "Source" is true then
  102.     set the name of me to "Hide LSP Source"
  103.   else set the name of me to "Show LSP Source"
  104. end mouseUp
  105.  
  106.  
  107.  
  108. -- part contents for background part 16
  109. ----- text -----
  110. FILETOFIELD XCMD version 1.2
  111. Kevin Calhoun
  112.  
  113. The FileToField XCMD allows you to copy the contents of a text file into a HyperCard field.  You may choose the text file to copy from by selecting it from a standard file dialog box or by specifying its full pathname.
  114.  
  115. If the text file is too large (just under 30K is the practical limit for HyperCard fields), FileToField won't try to copy it into the field.  If this or any other error occurs, FileToField will return an error message as the result.  Word 1 of this message will be "Error".  If the text was copied successfully, FileToField returns the full pathname of the file as the result.
  116.  
  117. INVOKING FILETOFIELD
  118. You may designate the field into which the text is to be copied in any way considered valid by HyperCard, by number, id, or name, with one exception:  you can't use the field's name if it is more than one word.  If you do use the field's name, don't put the field name in quotation marks.  Nested quotations confuse HyperCard.  (See the examples below.)
  119.  
  120. If you don't supply the pathname of the file to be copied from, FileToField will invoke SFGetFile, and the user can select the file from the dialog box.  If the user pushes the cancel buton of the dialog box, FileToField returns "Cancel" as the Result.
  121.  
  122. FileToField fieldDesignation,<full pathname of file>
  123.  
  124. examples--
  125.  
  126. FileToField("card field 1")                --these examples copy files chosen from the
  127. FileToField("bkgnd field id 16")       --standard file dialog into the specified field
  128. FileToField("card field Memorex")
  129.  
  130. FileToField "field 5","OldAchesAndPains:Good Stuff:Secrets"  --this copies the file 
  131. "Secrets" into background field 5.
  132.  
  133. REVISION HISTORY
  134. 7 March 1988: release of version 1.0
  135. 31 March 1988: release of version 1.1
  136.   --better reporting of memory errors
  137.   --more compact code
  138. 16 May 1988: release of version 1.2
  139.   -- fixed bug that bombed MacPlus (switched from PBHOpen to FSOpen)
  140.  
  141. -- part contents for card part 6
  142. ----- text -----
  143. UNIT FileToFieldUnit;
  144. { FileToField XCMD ¬©1988 by the Trustees of Dartmouth College. }
  145. { Written by John K. Calhoun, Courseware Development. }
  146.  
  147. { Project contains: }
  148. { MacTraps }
  149. { DA Paslib }
  150. { ROM85Lib }
  151. { HFS }
  152. { XCMD Interface.p }
  153. { FileToFieldXCMD.p (this file ) }
  154.  
  155. INTERFACE
  156.  USES
  157.   HFS, XCmdIntf;
  158.  
  159.  TYPE
  160.   Str31 = STRING[31];
  161.  
  162.  PROCEDURE main (paramPtr : XCmdPtr);
  163.  
  164. IMPLEMENTATION
  165.  
  166. {-----------------------------------------------------------------}
  167.  
  168. { The following routines are from the file XCMDUtilities.p. }
  169. { Instead of including the entire XCMD utilities file, }
  170. { we add to our code only the ones we actually need. }
  171. { This trims the size of our XCMD resource. }
  172.  
  173.  PROCEDURE DoJsr (addr : ProcPtr);
  174.  INLINE
  175.   $205F, $4E90;
  176.  
  177.  FUNCTION EvalExpr (paramPtr : XCmdPtr;
  178.          expr : Str255) : Handle;
  179.  BEGIN
  180.   WITH paramPtr^ DO
  181.    BEGIN
  182.     inArgs[1] := ORD(@expr);
  183.     request := xreqEvalExpr;
  184.     DoJsr(entryPoint);
  185.     EvalExpr := Handle(outArgs[1]);
  186.    END;
  187.  END;
  188.  
  189.  PROCEDURE ZeroToPas (paramPtr : XCmdPtr;
  190.          zeroStr : Ptr;
  191.          VAR pasStr : Str255);
  192.  BEGIN
  193.   WITH paramPtr^ DO
  194.    BEGIN
  195.     inArgs[1] := ORD(zeroStr);
  196.     inArgs[2] := ORD(@pasStr);
  197.     request := xreqZeroToPas;
  198.     DoJsr(entryPoint);
  199.    END;
  200.  END;
  201.  
  202.  FUNCTION StrToNum (paramPtr : XCmdPtr;
  203.          str : Str31) : LongInt;
  204.  BEGIN
  205.   WITH paramPtr^ DO
  206.    BEGIN
  207.     inArgs[1] := ORD(@str);
  208.     request := xreqStrToNum;
  209.     DoJsr(entryPoint);
  210.     StrToNum := outArgs[1];
  211.    END;
  212.  END;
  213.  
  214.  FUNCTION StringMatch (paramPtr : XCmdPtr;
  215.          pattern : Str255;
  216.          target : Ptr) : Ptr;
  217.  BEGIN
  218.   WITH paramPtr^ DO
  219.    BEGIN
  220.     inArgs[1] := ORD(@pattern);
  221.     inArgs[2] := ORD(target);
  222.     request := xreqStringMatch;
  223.     DoJsr(entryPoint);
  224.     StringMatch := Ptr(outArgs[1]);
  225.    END;
  226.  END;
  227.  
  228.  PROCEDURE SetFieldByID (paramPtr : XCmdPtr;
  229.          cardFieldFlag : BOOLEAN;
  230.          fieldID : INTEGER;
  231.          fieldVal : Handle);
  232.  BEGIN
  233.   WITH paramPtr^ DO
  234.    BEGIN
  235.     inArgs[1] := ORD(cardFieldFlag);
  236.     inArgs[2] := fieldID;
  237.     inArgs[3] := ORD(fieldVal);
  238.     request := xreqSetFieldByID;
  239.     DoJsr(entryPoint);
  240.    END;
  241.  END;
  242.  
  243.  FUNCTION PasToZero (paramPtr : XCmdPtr;
  244.          str : Str255) : Handle;
  245.  BEGIN
  246.   WITH paramPtr^ DO
  247.    BEGIN
  248.     inArgs[1] := ORD(@str);
  249.     request := xreqPasToZero;
  250.     DoJsr(entryPoint);
  251.     PasToZero := Handle(outArgs[1]);
  252.    END;
  253.  END;
  254.  
  255.  FUNCTION NumToStr (paramPtr : XCmdPtr;
  256.          num : LongInt) : Str31;
  257.   VAR
  258.    str : Str31;
  259.  BEGIN
  260.   WITH paramPtr^ DO
  261.    BEGIN
  262.     inArgs[1] := num;
  263.     inArgs[2] := ORD(@str);
  264.     request := xreqNumToStr;
  265.     DoJsr(entryPoint);
  266.     NumToStr := str;
  267.    END;
  268.  END;
  269.  
  270. {-----------------------------------------------------------------}
  271.  
  272. { Our routines begin here. }
  273.  
  274.  FUNCTION BuildThePathname (fName : Str255;
  275.          vRefNum : INTEGER) : Str255;
  276. { Given the "short name" and vRefNum of a file, returns the full pathname. }
  277. { This function is adapted from Steve Maller's FileName XFCN published in }
  278. { HyperTalk Programming by Dan Shafer, Howard W. Sams & Company, 1988, }
  279. { pp. 399-403. }
  280.   VAR
  281.    name, fullPathName : Str255;
  282.    err : INTEGER;
  283.    myWDPB : WDPBPtr;
  284.    myCPB : CInfoPBPtr;
  285.    myPB : HParmBlkPtr;
  286.  
  287.  BEGIN
  288.   fullPathName := '';     { start with an empty pathname }
  289. { Allocate some memory in the heap for the parameter block. }
  290.   myCPB := CInfoPBPtr(NewPtr(SizeOf(HParamBlockRec)));
  291.   IF ord4(myCPB) > 0 THEN    { continue if mem allocation was OK }
  292.  
  293.    BEGIN
  294.     myWDPB := WDPBPtr(myCPB);
  295.     myPB := HParmBlkPtr(myCPB);
  296. { same pointer, different variations of the record -- see IM IV, p. 117 }
  297.     name := '';     { start with an empty name for the volume }
  298.  
  299.     WITH myPB^ DO
  300.      BEGIN
  301.       ioNamePtr := @name;   { we want the volume name }
  302.       ioCompletion := pointer(0);
  303.       ioVRefNum := vRefNum;  { returned by SFGetFile }
  304.       ioVolIndex := 0;  { use the vRefNum and name only to designate volume }
  305.      END;
  306.     err := PBHGetVInfo(myPB, FALSE);  { fill in the volume info }
  307.     IF err = noErr THEN
  308.  
  309.      BEGIN
  310. { Now we need the Working Directory (WD) information because we're }
  311. { going to step backwards from the file through all of the folders until }
  312. { we reach the root directory. }
  313.       WITH myWDPB^ DO
  314.        BEGIN
  315.         ioVRefNum := vRefNum;  { this got set to 0 above }
  316.         ioWDProcID := 0;   { use the vRefNum }
  317.         ioWDIndex := 0;     { we want all directories }
  318.        END;
  319.       err := PBGetWDInfo(myWDPB, FALSE);
  320.       IF err = noErr THEN
  321.        BEGIN
  322.         WITH myCPB^ DO
  323.          BEGIN
  324.           ioFDirIndex := -1;   { use the ioDirID field only }
  325.           ioDrDirID := myWDPB^.ioWDDirID;   { info returned above }
  326.          END;
  327.         err := PBGetCatInfo(myCPB, FALSE);
  328.         IF err = noErr THEN
  329.          BEGIN
  330.  
  331. { Here starts the real work -- start to climb the tree by continually }
  332. { looking in the ioDrParID field for the next directory above until we fail... }
  333.           myCPB^.ioDrDirID := myCPB^.ioDrParID;  { the first folder }
  334.           fullPathName := CONCAT(myCPB^.ioNamePtr^, ':', fName);
  335.           REPEAT
  336.            myCPB^.ioDrDirID := myCPB^.ioDrParId;
  337.            err := PBGetCatInfo(myCPB, FALSE);    { the next level }
  338. { Be careful of an error returned here -- it means the user chose a file on the }
  339. { desktop level of this volume.  If this is the case, just stop here and return }
  340. { "VolumeName:FileName"; otherwise loop until failure. }
  341.            IF err = noErr THEN
  342.             fullPathName := CONCAT(myCPB^.ioNamePtr^, ':', fullPathName);
  343.           UNTIL err <> noErr;
  344.          END;  { if PBGetCatInfo worked OK }
  345.        END;  { if PBGetWDInfo worked OK }
  346.      END;  { if PBHGetVInfo worked OK }
  347.     DisposPtr(pointer(myCPB));
  348.    END;  { if we had enough room for a new pointer }
  349.   BuildThePathname := fullPathName;
  350.  END;
  351.  
  352.  FUNCTION GetLocOfCardWindow (paramPtr : XCmdPtr) : point;
  353.   VAR
  354.    theResult : Handle;
  355.    aString : Str255;
  356.    theLoc : point;
  357.  BEGIN
  358.   theResult := EvalExpr(paramPtr, 'item 1 of the loc of card window');
  359. { get horizontal coordinate of the card window }
  360.   ZeroToPas(paramPtr, theResult^, aString);  { turn it into a string }
  361.   DisposHandle(theResult);  { throw away the handle HC allocated }
  362.   theLoc.h := StrToNum(paramPtr, aString);
  363. { convert to a number and save it in theLoc }
  364.  
  365.   theResult := EvalExpr(paramPtr, 'item 2 of the loc of card window');
  366. { get vertical coordinate of the card window }
  367.   ZeroToPas(paramPtr, theResult^, aString);  { turn it into a string }
  368.   DisposHandle(theResult);  { throw away the handle HC allocated }
  369.   theLoc.v := StrToNum(paramPtr, aString);
  370. { convert it to a number and save it in theLoc }
  371.   GetLocOfCardWindow := theLoc;  { ...and return }
  372.  END;
  373.  
  374.  PROCEDURE passReturnValue (paramPtr : XCMDPtr;
  375.          theMsg : Str255); { set theResult }
  376.  BEGIN
  377.   paramPtr^.returnValue := PasToZero(paramPtr, theMsg);
  378.  END;
  379.  
  380.  PROCEDURE SetField (paramPtr : XCmdPtr;
  381.          theStringPtr : Ptr;
  382.          theTextHandle : handle);
  383.   VAR
  384.    whichField, theString : Str255;
  385.    cardFieldFlag : BOOLEAN;
  386.    matchPtr : Ptr;
  387.    theResult : Handle;
  388.    fieldID : INTEGER;
  389.  
  390.  BEGIN
  391. { get Pascal string that contains designation of field to be printed }
  392.   ZeroToPas(paramPtr, theStringPtr, whichField);
  393. { get long name of this field to see if it's a card or bkgnd field }
  394.   theResult := EvalExpr(paramPtr, CONCAT('the long name of ', whichField));
  395.   IF (paramPtr^.result = noErr) THEN
  396.    BEGIN
  397.     MoveHHi(theResult);
  398.     HLock(theResult);
  399.  
  400. { see if this thing actually is an extant field }
  401. { if HC returns a long field name with the word 'card' in it, we'll assume it's real }
  402.     matchPtr := StringMatch(paramPtr, 'card', theResult^);
  403.  
  404.     IF (matchPtr <> NIL) AND (paramPtr^.result = noErr) THEN  { this must be a field after all }
  405.      BEGIN
  406. { check to see if name of field contains 'card field' -- so we can set the cardFieldFlag }
  407.       matchPtr := StringMatch(paramPtr, 'card field', theResult^);
  408.       cardFieldFlag := (matchPtr <> NIL);
  409. { free the space allocated by EvalExpr above }
  410.       HUnlock(theResult);
  411.       DisposHandle(theResult);
  412.  
  413. { get the id of this field }
  414.       theResult := EvalExpr(paramPtr, CONCAT('the id of ', whichField));
  415.       IF (theResult <> NIL) AND (paramPtr^.result = noErr) THEN
  416.        BEGIN
  417.         MoveHHi(theResult);
  418.         HLock(theResult);
  419. { convert it into a string, then into a number }
  420.         ZeroToPas(paramPtr, theResult^, theString);
  421.         fieldID := StrToNum(paramPtr, theString);
  422.         HUnlock(theResult);
  423.         DisposHandle(theResult);  { and free the memory allocated by EvalExpr }
  424.  
  425.         SetFieldByID(paramPtr, cardFieldFlag, fieldID, theTextHandle);
  426.        END;
  427. { set the contents of the field to the contents of theTextHandle }
  428.      END;
  429.    END;
  430.   IF GetHandleSize(theResult) <> 0 THEN
  431.    BEGIN
  432.     HUnlock(theResult);
  433.     DisposHandle(theResult);
  434.    END;
  435.  END;
  436.  
  437.  PROCEDURE FileToField (paramPtr : XCmdPtr);
  438.   VAR
  439.    reply : SFReply;   { returned by SFGetFile }
  440.    fileName : Str255;  { name of file to open }
  441.    theVRefNum : INTEGER;  { ref num of volume (or directory) on which the file resides }
  442.    theRefNum : INTEGER;  { refNum of file, for file manager calls }
  443.    err : OSErr;  { save error codes for reporting trouble }
  444.    logEOF : longint;   { length of file }
  445.    theBufHndl : Handle;  { for copying contents of file into memory }
  446.    zeroByte : INTEGER;  { for appending zero byte on the end of the text }
  447.    zeroByteHndl : Handle;
  448.    parameterCount : INTEGER;  { the number of parameters passed to us }
  449.    didSFGet : BOOLEAN;
  450.  
  451.   PROCEDURE DoSFGet;
  452.    VAR
  453.     where : point;
  454.     typeList : SFTypeList;
  455.   BEGIN  { select text file to read using SFGetFile }
  456.  
  457.    SetPt(where, 82, 75); { tell SFGetFile where to put the dialog box }
  458.    AddPt(GetLocOfCardWindow(paramPtr), where);  { align the dialog box }
  459.                              { with current location of the card window }
  460.    typeList[0] := 'TEXT'; { tell SFGetFile to display only text files }
  461.    SFGetFile(where, '', NIL, 1, typeList, NIL, reply); { call SFGetFile }
  462.   END;
  463.  
  464.   FUNCTION GetFileName : Str255;
  465.            { return the name of the file to copy from }
  466.    VAR
  467.     temp : Str255;
  468.   BEGIN
  469.    IF parameterCount > 1 THEN  { second parameter, if present,  }
  470.                             { contains full pathname of file to copy from }
  471.     BEGIN
  472.      ZeroToPas(paramPtr, paramPtr^.params[2]^, temp);
  473.      didSFGet := FALSE;  { remember that we didn't call SFGet }
  474.     END
  475.    ELSE
  476.     BEGIN          { if second parameter isn't present, call SFGet }
  477.      doSFGet;
  478.      IF reply.good = TRUE THEN
  479.       temp := reply.fName  { return name of file user selected }
  480.      ELSE
  481.       temp := '';  { return empty file name if user pushed "Cancel" }
  482.      didSFGet := TRUE;  { remember that we called SF }
  483.     END;
  484.    GetFileName := temp;
  485.   END;
  486.  
  487.  BEGIN
  488.   parameterCount := paramPtr^.paramCount;  { store the paramCount }
  489.   IF parameterCount > 0 THEN  { check for parameters }
  490.  
  491. { If user passes no parameters I return my version number as the result and quit. }
  492. { If the required params are present, we perform the XCMD's main function.}
  493.  
  494.    BEGIN
  495.     fileName := GetFileName;  { get the name of the file to copy from }
  496.     IF fileName <> '' THEN
  497. { continue only if we have a file name, otherwise pass "cancel" as the result }
  498.      BEGIN
  499.       IF didSFGet THEN  { we've got the vRefNum and the file name  }
  500.        theVRefNum := reply.vRefNum
  501.       ELSE   { we have the full pathname but not the vRefNum }
  502.        theVRefNum := 0;  { tell FSOpen to use just the file name }
  503.       err := FSOpen(fileName, theVRefNum, theRefNum);
  504.       IF err = noErr THEN { continue only if file could be opened }
  505.        BEGIN
  506.         err := GetEOF(theRefNum, logEOF);  { find out how big the file is }
  507.         IF err = noErr THEN
  508.          IF logEOF < 29990 THEN  { continue only if file isn't too big to read into a HC field }
  509. { 29990 bytes is my experimental value for the maximum safe size of HC fields }
  510.           BEGIN
  511.            theBufHndl := NewHandle(logEOF);
  512. { set up the buffer in memory for reading in logEOF characters }
  513.            err := MemError;  { save the result for reporting errors }
  514.            IF (theBufHndl <> NIL) AND (err = noErr) THEN  { continue only if enough memory is available }
  515.             BEGIN
  516.              MoveHHi(theBufHndl);
  517.              HLock(theBufHndl);
  518.              err := FSRead(theRefNum, logEOF, theBufHndl^);
  519. { read logEOF characters into the location pointed to by theBufHandle^ }
  520.              IF err = noErr THEN      { continue only if the read worked }
  521.               BEGIN   { put a zero byte on the end of the text }
  522.                HUnlock(theBufHndl);
  523.                HNoPurge(theBufHndl);
  524.                zeroByteHndl := NewHandle(2);  { well, really two zero }
  525.                zeroByte := 0;                 { bytes, but who cares? }
  526.                zeroByteHndl^^ := zeroByte;
  527.                HLock(zeroByteHndl);
  528.                err := HandAndHand(zeroByteHndl, theBufHndl);
  529.                HUnlock(zeroByteHndl);
  530.                DisposHandle(zeroByteHndl);
  531.                HLock(theBufHndl);
  532.                IF err = noErr THEN
  533.                 BEGIN         { put the text into the field  }
  534.                  SetField(paramPtr, paramPtr^.params[1]^, theBufHndl);
  535.                  IF didSFGet THEN
  536.                   fileName := BuildThePathname(fileName, theVRefNum);
  537.                  passReturnValue(paramPtr, fileName);
  538.  
  539.       { return the file name as the result }
  540.                 END; { if we had no problem appending the zero byte }
  541.               END;  { if err = noErr when reading the file into memory }
  542.              HUnlock(theBufHndl);    { unlock the handle }
  543.              HPurge(theBufHndl);
  544.              DisposHandle(theBufHndl); { and deallocate the memory we used}
  545.             END   { if theBufHndl <> nil }
  546.            ELSE
  547.             passReturnValue(paramPtr, CONCAT('Error ', NumToStr(paramPtr, err)));
  548.           END        { if the file wasn't too big to read in }
  549.          ELSE
  550.           passReturnValue(paramPtr, 'Error (file too big)');
  551.         err := FSClose(theRefNum);            { close the file }
  552.        END;   { if err = noErr in opening the file }
  553.       IF err <> noErr THEN   { if we had an error, report it }
  554.        passReturnValue(ParamPtr, CONCAT('Error ', NumToStr(paramPtr, err)));
  555.      END
  556.     ELSE  { user pushed cancel in the SFGet box--report it }
  557.      passReturnValue(paramPtr, 'Cancel');
  558.    END  { if we got parameters }
  559.   ELSE
  560.    passReturnValue(paramPtr, 'FileToField XCMD 1.2 -- May 16, 1988');
  561.  END;
  562.  
  563.  
  564.  PROCEDURE main;
  565.  BEGIN
  566.   FileToField(paramPtr);
  567.  END;
  568.  
  569. END.